package com.example.chdemo.Mapper;

import com.example.chdemo.Dao.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PersonMapper {

    //查
    @Select("SELECT * FROM person")
    List<Person> getList();
    //查某个人
    @Select("SELECT * FROM person where id=#{id}")
    Person getOne(Integer id);
    //增
    @Insert("INSERT INTO person(name,age,gender,job,money)VALUES(#{name},#{age},#{gender},#{job},#{money})")
    int insert(Person person);
    //单个删
    @Delete("DELETE FROM person WHERE id=#{id}")
    int del(Integer id);
    //改
    @Update("UPDATE person SET name=#{name},age=#{age},gender=#{gender},job=#{job},money=#{money} WHERE id=#{id}")
    int upData(Person person);
}
